package com.whut.mapper;

import com.whut.parMapper.ParProblemCollectDetailMapper;
import com.whut.v_model.*;
import com.whut.v_vo.comperInsReportBaseVO.ProblemFirstListVO;
import com.whut.v_vo.equipReportBaseVO.CheckSuggestionVO;
import com.whut.v_vo.equipReportBaseVO.EquipExistProblemDesVO;
import com.whut.v_vo.newHiddenReportGLList;
import com.whut.v_vo.oldSysExamInfoVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ProblemCollectDetailMapper extends ParProblemCollectDetailMapper {
    int insert(ProblemCollectDetail record);

    int insertSelective(ProblemCollectDetail record);

    List<ProblemCollectDetail> selectZLInfoById(int checkId);

    List<ProblemCollectDetail> selectAQInfoById(int checkId);

    List<ProblemCollectDetail> selectGLInfoById(int checkId);

    List<ProblemCollectDetail> getAllProblemCollectInfoByCheckId(int checkId);

    List<Object> getAllName1(int checkId);

    List<ProblemCollectDetail> getFourthPoint(int checkId, String pName1, int secondId);

    List<ProblemCollectDetail> getZJFourthPoint(int checkId,int thirdId);

    List<ProblemCollectDetail> getZJSixthPoint(int checkId,int thirdId);

    int countName4(int fourthId, int checkId);

    int getAllNum(int checkId);

    List<Integer> getAllName4(int checkId);

    List<Integer> getAllName4ByName1(int checkId, String pName1);

    List<ProblemCollectDetail> getAllName6InfoByName4(int checkId, int fourthId, String pName1);

    List<ProblemCollectDetail> getsixthPoints(int checkId, int fourthId);

    List<ProblemCollectDetail> getZJsixthPoints(int checkId,int fourthId);

    float getdeductSum(int checkId, int sixthId);

    List<Object> getSecondId(int checkId, String pName1);

    List<Object> getThirdId(int checkId, String pName1, int secondId);

    //求总的extraReduce，cast是sqlserver的函数，数据库存的是varchar，转为float
    float getAllExtraPoint(int checkId);

    String getMaxRiskLever(int checkId, String pName1);

    String getOverAllLever(int checkId);

    List<Integer> getAllName1Id(int checkId);

    List<Object> getFourthId(int checkId, String pName1, int secondId, int thirdId);

    List<ProblemCollectDetail> getAllFourthInfo(int checkId, int fourthId);

    List<ProblemCollectDetail> getAllInfoByName1(int checkId, String pName1);

    List<Object> getFourthCountList(int checkId, int thirdId);

    ProblemCollectDetail getPCDBymkey(int mkey);

    int getRiskPointCount(int checkId, int fourthId, String riskPoint);

    int getAllRiskPointCountByType(int checkId, String riskPoint);

    List<Integer> getAllFirstIdByProjectInfoList(List<Integer> list);

    List<Integer> getAllSecondIdByProjectInfoList(int firstId, List<Integer> list);

    List<Integer> getAllThirdIdByProjectInfoList(int secondId, List<Integer> list);

    List<Integer> getAllFourthIdByProjectInfoList(int thirdId, List<Integer> list);

    List<Integer> getAllFifthIdByProjectInfoList(int fourthId, List<Integer> list);

    List<Integer> getAllSixthIdByProjectInfoList(int fifthId, List<Integer> list);

    List<Integer> getAllNextIdByFather(List<Integer> list,int number,String preNum);

    List<Integer> getAllTaskIdByCheckItemsAndCheckId(List<Integer> list,int checkItemsId,String name);

    int  getProblemNum(List<Integer>list,int taskId,int checkItemsId,String name);

    ProblemNumSearch1 getProblemSearch1Info(List<Integer>list,int taskId,int checkItemsId,String name);

    int getAllProblemNumForStatistic(List<Integer> list,int number,String preNum);

    List<Object> getAllName1IdForType3Report(int checkId,List<String> list);

    List<Object> getAllName4ByName1ForType3(int checkId,String pName1,List<String> list);

    List<ProblemCollectDetail> getAllName6InfoByName4ForType3(int checkId,int fourthId,String pName1,List<String> list);

    int getProblemNumByFourthId(int checkId,int fourthId);

    int getProblemNumOver3(int checkId,int fourthId,List<String>list);

    List<Integer> getAllZJthirdId(int checkId,int secondId);

    int getProblemNumByThirdId(int checkId,int thirdId);

    int getRiskPointNumOver3ByThirdId(int checkId,int thirdId,List<String> list);

    int getRiskPointNumOver3ByFourthId(int checkId,int fourthId,List<String> list);

    /*WYH*/
    /**
     * @Author wenyihan
     * @Description 获得单位问题数量的统计表格
     * @Date 15:43 2019/8/8
     * @Param checkIdList List<Integer> 检查ID的list
     * @Param unitNameList List<Object> 单位名称的list
     * @Param unitType String 单位类型
     * @Param idType String 对应problem_collect_detail视图中的第几层ID（例：firstId）
     * @Param prenumName String 对应problem_collect_detail视图中的preNumx（例：preNum1）
     * @Param pNameNum String 对应problem_collect_detail视图中的pNamex（例：pName1）
     * @Param preNum int 搜索最后一级的Id与idType对应
     * @return java.util.List<com.whut.v_model.UnitProblemNum>
     */
    List<UnitProblemNum> UnitProblemNumStatistic(List<Integer> checkIdList, List<Object> unitNameList, String unitType, String idType, String prenumName, String pNameNum, int preNum);

    List<ProblemCollectDetail> getAllInfoByFirstId(int checkId,int firstId);

    List<ProblemCollectDetail> selectAllInfoByThirdId(int checkId,int thirdId);

    int getZJGLProblemNumByThirdId(int checkId,int thirdId);

    int getZJGLProblemNumBySixthId(int checkId,int sixthId);

    List<Integer> getAllThirdIdByFirstId(int checkId,int firstId);

    List<Object> getAllName4ByThirdId(int checkId,int thirdId);

    /**
     * @Author wenyihan
     * @Description 通过checkIdList，unitNameList以及unitType从数据库中获取单位隐患等级统计表
     * @Date 17:59 2019/8/10
     * @Param [checkIdList, unitNameList， unitType]
     * @return java.util.List<com.whut.v_model.UnitRiskPoint>
     */
    List<UnitRiskPoint> UnitRiskPointStatistic(List<Integer> checkIdList, List<Object> unitNameList, String unitType);

    List<Integer> getAllFourthIdByCheckList(List<Integer> list,int firstId);

    TimesStat getAllSecurityRiskPoint(List<Integer> list,int firstId);

    int getAllSecurityProblemNum(List<Integer> list,int firstId);

    int getSecurityProblemNum(List<Integer> list,int fourthId);

    List<Integer> getSecurityPart3ProjectNum(List<Integer> list,int fourthId);

    TimesStat getSecurityRiskPoint(List<Integer> list,int fourthId);

    List<Integer> getSecurityInnerSixthId(List<Integer> list,int fourthId);

    int getPart3InnerProblemNum(List<Integer> list,int sixthId);

    List<Integer> getPart3InnerProject(List<Integer> list,int sixthId);

    /*wyh*/
    List<ProblemCollectDetail> getForthLevelByCheckId(int checkId);

    /*wyh*/
    List<ProblemCollectDetail> getProDescByCheckIdAndpName4(int checkId, String pName4);

    /*wyh*/
    List<ProblemCollectDetail> getPart3InnerDescriptionAllInfo(List<Integer> list,int sixthId);

    /*wyh*/
    List<ProblemCollectDetail> getSgList(int checkId);

    /*wyh*/
    List<ProblemCollectDetail> getJlList(int checkId);

    List<ProblemCollectDetail> getProDescByCheckIdAndpName4UnderSecur(int checkId, String pName4);

    List<Integer> getAllFourthId(int checkId);

    int getProblemNumByRiskPoint(int checkId,int fourthId,String riskPoint);

    List<String> allRiskPointListNotTiXing(int checkId,int fourthId);

    List<Integer> getAllFourthIdByNum(int checkId,int number);

    /**
     * @auther wenyihan
     * 获取建设工程施工安全监督抽查记录和巡查表的checkList
     * @date 17:01 2019/10/11
     * @param （checkId）
     * @return java.util.List<com.whut.v_model.ProblemCollectDetail>
    */
    List<ProblemCollectDetail> getPCDByCheckId(int checkId);

    //香港置地报告方法
    List<ProblemCollectDetail> getAllThirdInfoMXTQ(int checkId);
    List<ProblemCollectDetail> getAllFourthInfoMXTQ(int checkId,int thirdId);
    List<ProblemCollectDetail> getAllCheckFourthInfoMXTQ(int checkId);

    List<Integer> getAllFourthIdByCheckIdAndFirstId(int checkId,int firstId);
    List<ProblemCollectDetail> getRiskWarning(Integer contractId);
    List<ProblemCollectDetail> getProblemByProject(Integer checkId,Integer projectId);
    List<RiskWarning> getProblemByCheckandFirstId(List<Integer> list,Integer firstId);
    List<RiskWarning> getProblemByCheckandSecondId(List<Integer> list,Integer secondId);
    List<RiskWarning> getProblemByCheckandThirdId(List<Integer> list,Integer thirdId);
    List<RiskWarning> getProblemByCheckandFourthId(List<Integer> list,Integer fourthId);
    List<RiskWarning> getProblemByCheckandFifthId(List<Integer> list,Integer fifthId);
    List<RiskWarning> getProblemByCheckandSixthId(List<Integer> list,Integer sixthId);
    List<RiskWarning> getProblemsByContractandUnit(List<Integer> contractlist, List<String> jslist, List<String> jllist, List<String> sglist);

    int getAllGLFourthCount(int checkId);

    List<Object> getAllItemsBySecondName(String secondName, List<Integer> list);

    List<ProblemCollectDetail> getProblemDetail(int projectId, String reserve1);

    List<ProblemCollectDetail> getProblemsByTaskId(int taskId);

    List<ProblemCollectDetail> getNoProblemItem(int checkId, int secondId);

    int countFourthProblem(int checkId, int secondId, String name4);

    int countProblemBySecondId(int checkId, int secondId);

    List<ProblemCollectDetail> getEquipProblems(String eqipNum, int checkId, int fourthId);

    List<ProblemCollectDetail> requestThirdListAll(int checkId);

    List<ProblemCollectDetail> getProblemDescriptionBySixthId(int checkId, int sixthId);

    List<EquipExistProblemDesVO> getEquipExistProblemDesList(int checkId, int projectId);

    List<CheckSuggestionVO> getCheckSuggestionList(int checkId, int projectId);

    /**
     * @author： wenyihan
     * @date： 22:47 2020/11/29
     * @param： [checkId, projectId]
     * @return： java.util.List<com.whut.v_vo.comperInsReportBaseVO.ProblemFirstListVO>
    */
    List<ProblemFirstListVO> getProblemFirstList(int checkId, int projectId);

    List<Integer> getAllFourthIdByCheckIdAndThirdId(int checkId, int thirdId);

    List<Integer> getAllSixthIdBycheckIdAndFourthId(int checkId, int sixId);

    List<oldSysExamInfoVO> getOldSysFourthInfo(Integer checkId, Integer fourthId);

    //通过checkId获取管理行为下所有信息
    List<newHiddenReportGLList> getAllGLInfoByCheckId(int checkId);

    /**
     * Author:yjh
     * Description:返回所查所有问题信息
     * Create date:2021/3/8 12:58
     * Param:[String check]
     * Return:com.whut.v_model.ProblemCollectDetail
     * Modify[]:,,
     */
    List<ProblemCollectDetail> getAllInfoByCheck(@Param("check")String check);

    /**
     * Author:yjh
     * Description:
     * Create date:2021/3/8 13:01
     * Param:[List list1,String check]
     * Return:com.whut.v_model.ProblemCollectDetail
     * Modify[]:,,
     */
    List<ProblemCollectDetail> getAllInfoByCheckThirdId(@Param("list1")List list1,@Param("check")String check);

    /**
     * Author:yjh
     * Description:通过checkId,equipNum(设备编号),riskPoint(特征值)查询问题数量
     * Create date:2021/3/10 11:34
     * Param:[int checkId,String equipNum,String riskPoint]
     * Return:int
     * Modify[]:,,
     */
    int getProblemNumByCheckIdEquipNumRiskPoint(@Param("checkid")int checkId,@Param("equipnum")String equipNum,@Param("riskpoint")String riskPoint);

    /**
     * @author Lei
     * @description 从新的数据里面来拿
     * @date 18:44 2021/4/12
     * @params [checkId]
     * @return java.util.List<com.whut.v_model.ProblemCollectDetail>
     */
    List<ProblemCollectDetail> requesNewtThirdListAll(int checkId);
}